<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="box">
        <p>姓名:</p>
        <p>年龄:</p>
    </div>
    <script src="./js/template.js"></script>
    <script type="text/html" id="tel">
        <p>姓名:{{uname}}</p>
        <p>年龄:{{age}}</p>
    </script>
    <script>
        var data = {
            uname: 'zs',
            age: 13,
        }
        let str = template('tel', data)
        document.querySelector('#box').innerHTML = str
    </script>
</body>

</html>